package com.hdd.biz.member.controller;


import com.hdd.biz.finance.dto.WithdrawRecordRequest;
import com.hdd.biz.member.dto.APPMemberRequest;
import com.hdd.biz.member.dto.MemberListRequest;
import com.hdd.biz.member.dto.MemberRequest;
import com.hdd.biz.member.dto.ViolationRequest;
import com.hdd.biz.member.service.MemberService;
import com.hdd.dto.SuperResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * <p>
 * 系统用户表 前端控制器
 * </p>
 *
 * @author fang
 * @since 2021-02-25
 */
@RestController
@RequestMapping("/member")
@Api(value = "会员模块",tags = {"会员模块"})
@CrossOrigin(origins = "*",maxAge = 3600)
public class MemberController {


    @Autowired
    private MemberService memberService;

    @PostMapping("/list")
    @ApiOperation(value = "会员列表" ,notes = "")
    public SuperResponse list(@Valid @RequestBody MemberListRequest request ){
        return memberService.memberList(request);
    }

    @PostMapping("/info")
    @ApiOperation(value = "会员详情" ,notes = "")
    public SuperResponse info(@Valid @RequestBody MemberRequest request ){
        return memberService.info(request);
    }


    @PostMapping("/block")
    @ApiOperation(value = "会员审核" ,notes = "")
    public SuperResponse block(@Valid @RequestBody MemberRequest request ){
        return memberService.block(request);
    }

    @PostMapping("/trust")
    @ApiOperation(value = "信任" ,notes = "")
    public SuperResponse trust(@Valid @RequestBody MemberRequest request ){
        return memberService.trust(request);
    }

    @PostMapping("/violation")
    @ApiOperation(value = "违规" ,notes = "")
    public SuperResponse violation(@Valid @RequestBody ViolationRequest request ){
        return memberService.violation(request);
    }

    @PostMapping("/getInventedMember")
    @ApiOperation(value = "取出虚拟用户" ,notes = "")
    public SuperResponse getInventedMember(@Valid @RequestBody APPMemberRequest request ){
        return memberService.getInventedMember(request);
    }

    @PostMapping("/addInventedMember")
    @ApiOperation(value = "添加虚拟用户" ,notes = "")
    public SuperResponse addInventedMember(@Valid @RequestBody APPMemberRequest request ){
        return memberService.addInventedMember(request);
    }
}

